package com.lgj.auth.code.token;

import com.lgj.core.LoginUser;
import com.lgj.core.Oauth2Properties;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.security.oauth2.provider.OAuth2Authentication;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;

import java.util.Map;

/**
 * @Author：jim(liaoguangjie)
 * @Date：2025/4/21 11:08
 * @description：jwt 生成token
 */
public class JwtOauthTokenEnhancer implements TokenEnhancer {


    private Oauth2Properties oauth2Properties;

    public JwtOauthTokenEnhancer(Oauth2Properties oauth2Properties){
        this.oauth2Properties = oauth2Properties;
    }

    @Override
    public OAuth2AccessToken enhance(OAuth2AccessToken oAuth2AccessToken, OAuth2Authentication oAuth2Authentication) {
        if (oAuth2Authentication.getUserAuthentication() != null){
            LoginUser loginUser = (LoginUser) oAuth2Authentication.getPrincipal();

        }
        return null;
    }
}
